package ysq.xyg.ticket.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 销售模块-销售产品实体类
 *
 * @author shengQiang yu
 * @date 2019-10-24 10:15:36
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_ticket_product")
public class TicketProduct implements Serializable{

	/**
     * id
     */ 
	@Id
	private String id;
	
	/**
     * 名称
     */ 
	@Column(name = "name")
	private String name;
	
	/**
     * 所属栏目
     */ 
	@Column(name = "col_id")
	private String colId;
	
	/**
     * 缩略图
     */ 
	@Column(name = "thum_image")
	private String thumImage;
	
	/**
     * 轮播图，多个用“，”隔开
     */ 
	@Column(name = "images")
	private String images;
	
	/**
     * 门市价
     */ 
	@Column(name = "cost_price")
	private String costPrice;
	
	/**
     * 现价
     */ 
	@Column(name = "current_price")
	private String currentPrice;
	
	/**
     * 星星数量
     */ 
	@Column(name = "stars")
	private String stars;
	
	/**
     * 评分
     */ 
	@Column(name = "score")
	private String score;
	
	/**
     * 标签，多个用","隔开
     */ 
	@Column(name = "tags")
	private String tags;
	
	/**
     * 说明内容
     */ 
	@Column(name = "content")
	private String content;
	
	/**
     * 排序号，数据越大越往前
     */ 
	@Column(name = "sort")
	private String sort;
	
	/**
     * 供应商id
     */ 
	@Column(name = "supplier_id")
	private String supplierId;
	
	/**
     * 纬度，浮点数，范围为90 ~ -90
     */ 
	@Column(name = "latitude")
	private String latitude;
	
	/**
     * 经度，浮点数，范围为180 ~ -180。
     */ 
	@Column(name = "longitude")
	private String longitude;
	
	/**
     * 省id
     */ 
	@Column(name = "province_id")
	private String provinceId;
	
	/**
     * 城市id
     */ 
	@Column(name = "city_id")
	private String cityId;
	
	/**
     * 区域id
     */ 
	@Column(name = "area_id")
	private String areaId;
	
	/**
     * 详细地址
     */ 
	@Column(name = "address")
	private String address;
	
	/**
     * 一级分销金额，0默认为无分销
     */ 
	@Column(name = "share_one_money")
	private String shareOneMoney;
	/**
	 * 二级分销金额，0默认为无分销
	 */
	@Column(name = "share_two_money")
	private String shareTwoMoney;
	/**
     * 是否展示:1、是，2、否
     */ 
	@Column(name = "show_type")
	private String showType;
	/**
	 * 排行榜展示:1、是，2、否
	 */
	@Column(name = "rank_show")
	private String rankShow;
	/**
	 * 首页展示:1、是，2、否
	 */
	@Column(name = "frist_show")
	private String fristShow;
	/**
     * 删除标识：1、正常，2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	/**
	 * 区域名称
	 */
	@Transient
	private String areaName;
	/**
	 * 轮播图集合
	 */
	@Transient
	private String[] imageList;

	/**
	 * 标签集合
	 */
	@Transient
	private String[] tagList;

	public TicketProduct(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}